package com.zhiyou100.springbootmybatisplus.controller;

import com.zhiyou100.springbootmybatisplus.common.Result;
import com.zhiyou100.springbootmybatisplus.pojo.Menu;
import com.zhiyou100.springbootmybatisplus.pojo.User;
import com.zhiyou100.springbootmybatisplus.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author YourName
 * @since 2025-01-15
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/list")
    public Result list(@RequestParam String roleId){
        List list = menuService.lambdaQuery().like(Menu::getMenuRight, roleId).list();
        return  Result.suc(list);
    }

}
